<template>
	<view class="content">
		<view class="">
			<scroll-view scroll-top="0" scroll-y='true' @scrolltolower="more">
				<view class="noData" v-if="customer.list.length<1">暂无数据</view>
				<view class="row" @tap="navTo('/pages/works/detail?id='+item.id)" v-for="(item,index) in customer.list" :key="index" v-else>
					<view class="record-list">
						<view class="" style="display: flex;">
							<image v-if="item.sex==0" src="../../static/sex0.png" style="display: inline-block; width: 32px;height: 32px;margin-right: 10px;"></image>
							<image v-else src="../../static/sex1.png" style="display: inline-block; width: 32px;height: 32px;margin-right: 10px;"></image>
							<view class="record-list-title">{{item.realname||"-"}} ({{item.mobile||" "}})</view>
							
						</view>
						<uni-icons type="arrowright" class="record-list-icon" style="font-size: 48upx; vertical-align: middle; color: #d1d1d1;"></uni-icons>
						<view class="record-list-title">备注：{{item.content||"-"}}</view>
						<view class="uni-time">录入时间：{{item.createtime|time}}</view>
					</view>
				</view>
			</scroll-view>
		</view>
		<view class="add-round bg-deepBlue" :class="'bg-' + themeColor.name" @click="navTo(`/pages/customer/add`)">
			<text class="cuIcon-add text-xxl"></text>
		</view>
	</view>
</template>

<script>
	import { customer } from '@/api/product';
	import moment from '@/common/moment';
	export default {
		components: {  },
		data() {
			return {
				customer:{
					list:[{}]
				}
			};
		},
		onLoad() {
			customer().then(data => {
				this.customer.list=data.list
			});
		},
		methods: {
			// 通用跳转
			navTo(route) {
				if (!route) return;
				this.$mRouter.push({
					route
				});
			},
		},
		filters: {
			time(val) {
				return moment(val * 1000).format('YYYY-MM-DD HH:mm:ss');
			},
			date(val) {
				return moment(val * 1000).format('YYYY-MM-DD');
			},
		},
	};
</script>

<style lang="scss">
	@import url("@/static/css/common.css");
	page {
		background-color: $page-color-base;
	}
	.add-round {
		position: fixed;
		z-index: 999;
		right: 30rpx;
		bottom: 30rpx;
		border-radius: 50%;
		width: 120rpx;
		height: 120rpx;
		color: #fff;
		text-align: center;
		line-height: 120rpx;
		font-weight: 100;
		font-size: 80rpx;
	}
</style>
